Detecting List

Different user, use different methods to make a list. Some uses doors bullets, some use tab with ascii bullets etc.

This inconsistency makes absolute detection of a list a challenge. Has anyone developed a dxl that has a high probability of detecting the various forms of list that they are willing to post?
OurGuest - Wed Dec 26 07:51:29 EST 2012

Re: Detecting List
llandale - Mon Jan 07 10:01:19 EST 2013

No, but I recently had a similar issue trying to find headings in Object Text. I wonder if the following is useful. Looking at raw text...
  • is there more than 2 EOLs
  • is there a TAB in the first few characters
  • is the first few characters dominated with white-space
  • does a RichTextParagraph have characteristic "bullet"

-Louie

Re: Detecting List
Mathias Mamsch - Fri Jan 11 05:59:55 EST 2013

I wrote an RTF parser once to handle a complex bullet point manipulation task. At the moment this one handles fi, li and pard tags to track the indentation of the paragraph, which is probably an important point for detecting lists. You can use the code with a loop that handles certains states, e.g. I am at the begin of a paragraph, etc. I always wanted to put a high level interface (flow document) over it, but I never came around to do so.

Would you be interested in having that RTF parser open source? Still looking for people who would be willing to commit to an open source DXL library. Sorry, that the library is not well commented, but I guess you will get the functionality pretty fast. You can use the nextToken() function in a loop to parse the RTF and then roam around in the tokens by using getToken(RTFParser, int) to look forward, backwards. The RTFParser also tracks the group name, which you can use to determine the location in the rtf, e.g. "rtf:fnttble:fnt" or something like this tells you, that you are in the font table of the rtf.

I am not sure this will help, but I am pretty sure, for reliably detecting lists you will need to parse RTF. Additionally you probabably need to define the criteria that you would use for detecting lists, e.g. more than one space or a tab or a line indent followed by a bullet symbol or a number or and all of that at least twice?

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Attachments

attachment_14927969_RTFFunctions.dxl

Re: Detecting List
SystemAdmin - Tue Jan 15 03:32:18 EST 2013

Mathias Mamsch - Fri Jan 11 05:59:55 EST 2013
I wrote an RTF parser once to handle a complex bullet point manipulation task. At the moment this one handles fi, li and pard tags to track the indentation of the paragraph, which is probably an important point for detecting lists. You can use the code with a loop that handles certains states, e.g. I am at the begin of a paragraph, etc. I always wanted to put a high level interface (flow document) over it, but I never came around to do so.

Would you be interested in having that RTF parser open source? Still looking for people who would be willing to commit to an open source DXL library. Sorry, that the library is not well commented, but I guess you will get the functionality pretty fast. You can use the nextToken() function in a loop to parse the RTF and then roam around in the tokens by using getToken(RTFParser, int) to look forward, backwards. The RTFParser also tracks the group name, which you can use to determine the location in the rtf, e.g. "rtf:fnttble:fnt" or something like this tells you, that you are in the font table of the rtf.

I am not sure this will help, but I am pretty sure, for reliably detecting lists you will need to parse RTF. Additionally you probabably need to define the criteria that you would use for detecting lists, e.g. more than one space or a tab or a line indent followed by a bullet symbol or a number or and all of that at least twice?

Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Hello Mathias

> I wrote an RTF parser once to handle a complex bullet point manipulation task.

May be that the project http://nrtftree.sourceforge.net/ is a good template for this.

Best regards
Wolfgang